<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // function Car(name, price, size) {
      //   this.name = name;
      //   this.price = price;
      //   this.size = size;
      // }

      // var benc = new Car('benc', '40w', 'big');
      // console.log(benc);

      // var audi = new Car('30w', 'audi', 'small');
      // console.log(audi);
      function Car(obj) {
        this.name = obj.name;
        this.price = obj.price;
        this.size = obj.size;
      }

      var audi = new Car({ size: 'small', name: 'audi', price: '30w' });
      console.log(audi);
    </script>
  </body>
</html>
